package com.hzy.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.hzy.bean.UserAddress;
import com.hzy.service.OrderService;
import com.hzy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 1.将服务提供者注册到注册中心
 *      1.导入dubbo依赖和zookeeper依赖
 *      2.配置服务提供者
 *      3.
 * 2.让服务消费者去注册中心订阅服务提供者的服务地址
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private UserService userService;
    @Override
    public List<UserAddress> initOrder(String userId) {
        System.out.println("用户ID"+userId);
        //1.查询用户的收货地址
        List<UserAddress> userAddressList = userService.getUserAddressList(userId);
        userAddressList.forEach(System.out::println);
        return userAddressList;
    }
}
